﻿using System;
using UnityEngine;

namespace Adventure
{
    /// <summary>
    /// 游戏存档数据
    /// </summary>
    [Serializable]
    public class GameData
    {
        #region 秘钥

        public GameData(string key)
        {
            Key = key;
            player = new PlayerData();
            playerBackpacker = new  PlayerBackpacker();
        }
        public GameData() { }

        /// <summary>
        /// 秘钥，防止拷贝存档
        /// </summary>
        [field: SerializeField]
        public string Key { get; private set; }

        #endregion

        /// <summary>
        /// 玩家信息
        /// </summary>
        [field: SerializeField]
        public PlayerData player { get; private set; }

        /// <summary>
        /// 金币
        /// </summary>
        public int Gold
        {
            get;
            set;
        }
        /// <summary>
        /// 击杀个数
        /// </summary>
        public int KillCount
        {
            get;
            set;
        }

        /// <summary>
        ///成就的 背包使用个数
        /// </summary>
        public int BackpackerCount
        {
            get;
            set;
        }
        /// <summary>
        ///成就的 商店购买个数
        /// </summary>
        public int ShopCount
        {
            get;
            set;
        }

        //背包
        [field: SerializeField]
        public PlayerBackpacker  playerBackpacker { get; private set; }

    }

    public class PlayerBackpacker
    {
        public PlayerBackpacker() 
        
        {
            EXPNum_10=0;
            EXPNum_20 = 0;
            EXPNum_50 = 0;
            YaoShuiNum_10 = 0;
            YaoShuiNum_20 = 0;
            YaoShuiNum_50 = 0;
        }
        public int EXPNum_10;
        public int EXPNum_20;
        public int EXPNum_50;
        public int YaoShuiNum_10;
        public int YaoShuiNum_20;
        public int YaoShuiNum_50;

    }
}